Skip to content

Add java to monorepo: Phase 02: code and test CI.#1348

Open
edburns wants to merge 49 commits into
mainfrom
edburns/80-java-monorepo-add-phase-01
Open

Add java to monorepo: Phase 02: code and test CI.#1348
edburns wants to merge 49 commits into
mainfrom
edburns/80-java-monorepo-add-phase-01

Conversation

@edburns
Copy link
Copy Markdown
Collaborator

@edburns edburns commented May 20, 2026

Implements phase 02 of the plan.

Reviewer Guide

This PR brings the Java SDK into the monorepo and adds the supporting monorepo plumbing needed to build and test it. Publish and regeneration are in a later phase. For review, the easiest path is to split the changes into two buckets.

Successful test runs

Bucket 1: Everything Else

This bucket is the monorepo integration layer around Java. It is mostly repository infrastructure, workflow wiring, automation, and policy.

Follow-up gh aw fixup commits

After the initial Java import, there is a second pass of 12 follow-up commits that fixed gh aw and monorepo workflow problems arising from the upgrade of gh aw to the latest version.

Reviewer focus for this follow-up set:

  • Treat the series as workflow/automation cleanup that made gh aw and the monorepo Java plumbing behave correctly.
  • Highest-signal files are .github/workflows/java-sdk-tests.yml, .github/workflows/codegen-check.yml, .github/workflows/java-codegen-check.yml, .github/workflows/java-codegen-fix.md, .github/workflows/java-codegen-fix.lock.yml, .github/workflows/copilot-setup-steps.yml, .github/aw/actions-lock.json, .github/dependabot.yaml, and .gitignore.

Actions and workflow support

  • .github/actions/java-test-report/action.yml
  • .github/aw/actions-lock.json
  • .github/workflows/copilot-setup-steps.yml
  • .githooks/pre-commit
  • .github/copilot-instructions.md
  • .github/skills/java-coding-skill/SKILL.md

What changed here:

  • Adds Java-aware test reporting support.
  • Extends the Copilot setup workflow so the coding-agent environment installs Java tooling and enables the repo hook path.
  • Adds Java-specific instructions and skills so agents treat java/ work like first-class repo content.
  • Adds the pre-commit hook used by the Java repo flow. Only does anything on actual java changes.

Codegen and automation outside java/

  • .github/workflows/codegen-check.yml
  • .github/workflows/java-codegen-check.yml
  • .github/workflows/java-codegen-fix.md
  • .github/workflows/java-codegen-fix.lock.yml

What changed here:

  • Pulls Java-specific codegen validation out into dedicated workflow handling.
  • Adds the agentic workflow used to repair Java generated sources when schema changes land.
  • Keeps the generic codegen check from trying to do all Java work inline.

Other non-Java workflow and repo changes

  • .github/dependabot.yaml
  • .gitignore

What changed here:

  • Dependabot is extended to understand Maven and Java codegen npm ecosystems.
  • Ignore rules are updated for Java logs and generated local artifacts.

Non-Java workflows that do not start with java-

  • .github/workflows/copilot-setup-steps.yml
  • .github/workflows/codegen-check.yml

Reviewer focus:

  • Confirm the monorepo automation now recognizes Java as a supported SDK.
  • Confirm the repo-level setup steps are enough for CI and agent environments.
  • Confirm Java-specific codegen handling is isolated cleanly from the generic workflow.

Bucket 2: Java-Specific Stuff

This bucket is the actual Java SDK import plus the workflows and scripts that make it behave like a first-class monorepo package.

Java directory import

Top-level Java package files:

  • java/.lastmerge
  • java/.mvn/wrapper/maven-wrapper.properties
  • java/CHANGELOG.md
  • java/README.md
  • java/jbang-example.java
  • java/mvnw
  • java/mvnw.cmd
  • java/pom.xml

Java configuration and docs:

  • java/config/checkstyle/checkstyle.xml
  • java/config/spotbugs/spotbugs-exclude.xml
  • java/docs/adr/adr-001-semver-pre-general-availability.md
  • java/docs/adr/adr-002-maven-version-and-reference-implementation-tracking.md

Java codegen tooling:

  • java/scripts/codegen/.gitignore
  • java/scripts/codegen/java.ts
  • java/scripts/codegen/package.json
  • java/scripts/codegen/package-lock.json

Java source and tests:

  • java/src/main/**
  • java/src/test/**
  • java/src/generated/java/**

What changed here:

  • Copies the standalone Java SDK into java/.
  • Preserves the Maven wrapper, POM structure, docs, examples, changelog, and release metadata.
  • Brings over the generated event/RPC classes and the Java codegen toolchain used to maintain them.
  • Keeps the existing Java test harness integration, including the antrun/git-clone path needed by tests that still rely on the reference harness layout.

Java workflows that start with java-

  • .github/workflows/java-sdk-tests.yml
  • .github/workflows/java-codegen-check.yml
  • .github/workflows/java-codegen-fix.md
  • .github/workflows/java-codegen-fix.lock.yml
  • .github/workflows/java-publish-maven.yml
  • .github/workflows/java-publish-snapshot.yml

Note: the base addition of these files belongs in Bucket 2, but the later gh aw fixup commits that touched java-sdk-tests.yml, java-codegen-check.yml, and java-codegen-fix* are called out in Bucket 1 above because they are follow-up workflow plumbing fixes.

Java scripts and workflow helpers

  • .github/scripts/generate-java-coverage-badge.sh

What changed here:

  • Adds a Java-only CI workflow adapted from the standalone build-test.yml.
  • Adds Java publication workflows for Maven Central releases and snapshots.
  • Adds Java-specific coverage badge generation.
  • Adds Java codegen validation and repair flows.

Reviewer focus inside the Java-specific bucket:

  1. java/pom.xml

    • This is the highest-signal file in the PR.
    • Review the monorepo adaptations carefully: harness setup, codegen integration, reporting, publishing, and retained compatibility with the standalone build.
  2. .github/workflows/java-sdk-tests.yml

    • This is the highest-signal workflow file.
    • Review it against the standalone copilot-sdk-java-00/.github/workflows/build-test.yml with attention to step ordering and side effects.
    • Important equivalences to verify:
      • Java setup and Node setup are both present.
      • Copilot CLI setup is still validated.
      • Javadoc generation now compiles first so module metadata exists before javadoc:javadoc runs.
      • Test execution uses mvn verify and the required Copilot env vars.
      • Badge generation and test-report publishing behavior are preserved for main.
  3. java/scripts/codegen/* and java/src/generated/java/**

    • Review these as a pair.
    • Confirm the generator inputs and generated outputs are aligned.
    • Generated files are large; review by spot-checking representative classes and verifying the workflow support rather than line-by-line reading.
  4. java/src/main/** and java/src/test/**

    • This is primarily a repo relocation/import from the standalone Java SDK.
    • Review for unintended monorepo-specific edits rather than re-reviewing the entire SDK from first principles.

Suggested Review Order

  1. java/pom.xml
  2. .github/workflows/java-sdk-tests.yml
  3. Java publish/codegen workflows under .github/workflows/java-*
  4. .github/actions/java-test-report/action.yml
  5. java/scripts/codegen/*
  6. java/src/generated/java/** (spot-check only)
  7. java/src/main/** and java/src/test/**
  8. Remaining repo-level files (dependabot, setup steps, hook, skills/instructions)

edburns and others added 30 commits May 19, 2026 13:42
…thub.com/github/cnew file:   80-java-monorepo-add-01-remove-before-merge/20260512-prompts.md

- Commence practice of keeping running prompts for sharing and review.

new file:   80-java-monorepo-add-01-remove-before-merge/dd-2989727-move-java-to-monorepo-plan.md

- Document WIP plan for review.
modified:   80-java-monorepo-add-01-remove-before-merge/dd-2989727-move-java-to-monorepo-plan.md


modified:   .github/CODEOWNERS

- Add row mapping `java` to `@github/copilot-sdk-java`.

modified:   80-java-monorepo-add-01-remove-before-merge/dd-2989727-move-java-to-monorepo-plan.md

- Fix reference.

new:        80-java-monorepo-add-01-remove-before-merge/20260513-prompts.md

- Today's prompts.
modified:   80-java-monorepo-add-01-remove-before-merge/20260513-prompts.md
modified:   80-java-monorepo-add-01-remove-before-merge/dd-2989727-move-java-to-monorepo-plan.md

- WIP Phase 0.

.github/workflows/java-publish-maven.yml
.github/workflows/java-publish-snapshot.yml

- Copy over from `copilot-sdk-java-00`.

80-java-monorepo-add-01-remove-before-merge/ghcpsp-90-gpg-key-archive.sh
80-java-monorepo-add-01-remove-before-merge/ghcpsp-90-gpg-key-import.sh

- Durable way to hand off the ability to publish to maven central. Currently resides with @edburns.
Copied from github/copilot-sdk-java: src/, pom.xml, config/,
scripts/codegen/, CHANGELOG.md, README.md, jbang-example.java,
.lastmerge, docs/adr/, mvnw, mvnw.cmd, .mvn/, .gitignore, test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Since the Java SDK now lives inside the copilot-sdk monorepo,
point copilot.sdk.clone.dir at the monorepo root (../)
instead of cloning into target/. Remove the antrun git clone
execution entirely. Update SCM URLs to github/copilot-sdk.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Revert pom.xml to preserve the git-clone-based test harness setup
(copilot.sdk.clone.dir = target/copilot-sdk/) instead of pointing at
the monorepo root. Add scripts/codegen/package-lock.json (pins
@github/copilot@1.0.49-3) and .gitignore that were missed in the
initial file copy.
edburns and others added 12 commits May 19, 2026 16:20
- Add push path filter (java/**, test/**, workflow, actions)
- Remove OS matrix, run on ubuntu-latest only
- Set permissions: contents write, checks write, pull-requests write
- Use SHA-pinned actions (matching copilot-sdk-java source)
- Add persist-credentials: false on checkout
- Use .github/actions/setup-copilot for COPILOT_CLI_PATH
- Add COPILOT_GITHUB_TOKEN and COPILOT_CLI_PATH env vars to mvn verify
- Add JaCoCo badge generation (generate-java-coverage-badge.sh)
- Add JaCoCo badge PR creation (peter-evans/create-pull-request)
- Add java-test-report composite action for step summary
- Upload test results artifact on main branch for site generation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reverts codegen-check.yml to its composition on main (no Java paths).
Creates java-codegen-check.yml adapted from the standalone repo's
codegen-check.yml with monorepo paths (java/ prefix, working-directory).
Updates java-codegen-fix.md to reference java-codegen-check workflow.

The java-codegen-fix.lock.yml could not be re-compiled because gh aw
is not responsive in this environment. Run 'gh aw compile java-codegen-fix'
to regenerate it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Replace curl|bash gh-aw install with pinned setup action
  (github/gh-aw@4d44d0e89 v0.73.0, version: v0.68.3)
- Add 'git config core.hooksPath .githooks' to enable the repo-root
  pre-commit hook (runs Spotless on java/src/ changes)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add ignore rules for actions/github-script and github/gh-aw-actions
  to the github-actions entry (SHAs managed by gh aw compile)
- Add ignore for major version bumps on Maven dependencies (may drop
  Java 17 support or have breaking API changes)
- Use dedicated groups for Java: java-maven-deps and java-codegen-deps
  (separate from the monorepo-wide multi-ecosystem-group)
- Give Java entries their own schedule instead of multi-ecosystem-group

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@edburns edburns marked this pull request as ready for review May 20, 2026 18:30
@edburns edburns requested a review from a team as a code owner May 20, 2026 18:30
Copilot AI review requested due to automatic review settings May 20, 2026 18:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Comment thread .github/workflows/java-publish-snapshot.yml
@edburns edburns changed the title Add java to monorepo: Phase 01: code and test CI. Add java to monorepo: Phase 02: code and test CI. May 20, 2026
@edburns edburns requested a review from stephentoub May 20, 2026 20:48
echo "Reference implementation SDK sync: ${REFERENCE_IMPL_SHORT} (${REFERENCE_IMPL_URL})"

# Update CHANGELOG.md with release version and Reference implementation sync hash
./.github/scripts/release/update-changelog.sh "${VERSION}" "${REFERENCE_IMPL_HASH}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stephentoub Yes, we have a Java specific CHANGELOG.md: https://github.com/github/copilot-sdk-java/blob/main/CHANGELOG.md and it is updated automatically. We need to decide whether to carry it forward or not, or perhaps to bring the concept to the top level

I'm ok either way. Perhaps it's best to remove the concept for now?

Comment thread .github/workflows/java-publish-maven.yml
Comment thread .github/workflows/java-publish-maven.yml
Comment thread .github/workflows/java-publish-maven.yml
Comment thread .gitignore
Comment thread java/src/site/markdown/cookbook/README.md
Comment thread java/src/site/markdown/getting-started.md
@edburns
Copy link
Copy Markdown
Collaborator Author

edburns commented May 20, 2026

I will also turn on the Java/Kotlin CodeQL once this gets merged.

@edburns edburns requested a review from brunoborges May 20, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants